<script type="text/javascript">
xe.lang.msg_empty_search_target = '{$lang->msg_empty_search_target}';
xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
</script>
<load target="js/poll_admin.js" usecdn="true" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="" class="form">
	<input type="hidden" name="module" value="poll" />
	<h1 class="h1">{$lang->poll}</h1>
	<div class="table even">
		<table width="100%" border="1" cellspacing="0" id="pollListTable">
			<caption>
				All({number_format($total_count)})
				<span class="side"><span class="btn"><a href="#listManager" class="modalAnchor" onclick="getPollList();">{$lang->poll_manager}...</a></span></span>
			</caption>
			<thead>
				<tr>
					<th scope="col" class="text">{$lang->title}</th>
					<th scope="col" class="nowr">{$lang->poll_checkcount}</th>
					<th scope="col" class="nowr">{$lang->poll_join_count}</th>
					<th scope="col" class="nowr">{$lang->author}</th>
					<th scope="col" class="nowr">{$lang->regdate}</th>
					<th scope="col" class="nowr">{$lang->poll_stop_date}</th>
					<th scope="col"><input type="checkbox" data-name="cart"title="Check All" /></th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<th scope="col" class="text">{$lang->title}</th>
					<th scope="col" class="nowr">{$lang->poll_checkcount}</th>
					<th scope="col" class="nowr">{$lang->poll_join_count}</th>
					<th scope="col" class="nowr">{$lang->author}</th>
					<th scope="col" class="nowr">{$lang->regdate}</th>
					<th scope="col" class="nowr">{$lang->poll_stop_date}</th>
					<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
				</tr>
			</tfoot>
			<tbody>
				<!--@foreach($poll_list as $no => $val)-->
				<tr>
					<td class="title"><a href="<!--@if($val->document_srl)-->{getUrl('')}?document_srl={$val->document_srl}<!--@end--><!--@if($val->comment_srl)-->#comment_{$val->comment_srl}<!--@end-->" target="_blank">{$val->title}</a></td>
					<td class="nowr"><!--@if($val->checkcount == 1)-->{$lang->single_check}<!--@else-->{$lang->multi_check}<!--@end--></td>
					<td class="nowr">{$val->poll_count}</td>
					<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
					<td class="nowr">{zdate($val->poll_regdate,"Y-m-d H:i")}</td>
					<td class="nowr">{zdate($val->poll_stop_date,"Y-m-d")}</td>
					<td>
						<input type="checkbox" name="cart" value="{$val->poll_index_srl}" />
					</td>
				</tr>
				<!--@end-->
			</tbody>
		</table>
		<div class="btnArea">
			<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getPollList();">{$lang->poll_manager}...</a></span>
		</div>
	</div>
</form>
<div class="modal" id="listManager">
	<form ruleset="deleteChecked" action="./" method="post" class="fg form">
	<input type="hidden" name="module" value="poll" />
	<input type="hidden" name="act" value="procPollAdminDeleteChecked" />
	<input type="hidden" name="page" value="{$page}" />
		<h2 class="h2">{$lang->poll_manager}</h2>
		<div class="table">
			<table width="100%" border="1" cellspacing="0" id="pollManageListTable">
				<caption>{$lang->selected_poll} <strong id="selectedPollCount"></strong></caption>
				<thead>
					<tr>
						<th scope="col" class="text">{$lang->title}</th>
						<th scope="col">{$lang->poll_join_count}</th>
						<th scope="col">{$lang->author}</th>
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>
		</div>
		<div class="btnArea">
			<span class="btn"><input type="submit" value="Delete" /></span>
		</div>
	</form>
</div>
<div class="search">
<form action="" class="pagination">
	<input type="hidden" name="error_return_url" value="" />
	<input type="hidden" name="module" value="{$module}" />
	<input type="hidden" name="act" value="{$act}" />
  	<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
  	<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />

	<a href="{getUrl('page', '')}" class="direction">&laquo; FIRST</a>
	<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
		{@$isGoTo = true}
		<a href="{getUrl('page', '')}">1</a>
		<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
	</block>
	<!--@while($page_no = $page_navigation->getNextPage())-->
		{@$last_page = $page_no}
		<strong cond="$page_no == $page">{$page_no}</strong>
		<a cond="$page_no != $page" href="{getUrl('page', $page_no)}">{$page_no}</a>
	<!--@end-->
	<block cond="$last_page != $page_navigation->last_page">
		{@$isGoTo = true}
		<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
		<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
	</block>
	<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">LAST &raquo;</a>
	<span cond="$isGoTo" id="goTo" class="tgContent">
		<input name="page" title="{$lang->cmd_go_to_page}" />
		<button type="submit">Go</button>
	</span>
</form>

	<form action="./" method="get" onsubmit="return checkSearch(this)">		
	<input type="hidden" name="module" value="{$module}" />
	<input type="hidden" name="act" value="{$act}" />
	<input type="hidden" name="error_return_url" value="" />
		<select name="search_target">
			<option value="">{$lang->search_target}</option>
			<!--@foreach($lang->search_target_list as $key => $val)-->
			<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
			<!--@end-->
		</select>
		<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
		<input type="submit" value="{$lang->cmd_search}" />
		<a href="{getUrl('','module',$module,'act',$act)}">{$lang->cmd_cancel}</a>
	</form>
</div>
